using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._LinearReferencingTools
{
    /// <summary>
    /// <para>Create Routes</para>
    /// <para>Creates routes from existing lines. The input line features that share a common identifier are merged to create a single route.</para>
    /// <para>从现有线路创建路径。共享公共标识符的输入线要素将合并以创建单个路径。</para>
    /// </summary>    
    [DisplayName("Create Routes")]
    public class CreateRoutes : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateRoutes()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_line_features">
        /// <para>Input Line Features</para>
        /// <para>The features from which routes will be created.</para>
        /// <para>将从中创建路由的要素。</para>
        /// </param>
        /// <param name="_route_id_field">
        /// <para>Route Identifier Field</para>
        /// <para>The field containing values that uniquely identify each route.</para>
        /// <para>包含唯一标识每个路由的值的字段。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Route Feature Class</para>
        /// <para>The feature class to be created. It can be a shapefile or a geodatabase feature class.</para>
        /// <para>要创建的要素类。它可以是 shapefile 或地理数据库要素类。</para>
        /// </param>
        /// <param name="_measure_source">
        /// <para>Measure Source</para>
        /// <para><xdoc>
        ///   <para>Specifies how route measures will be obtained.</para>
        ///   <bulletList>
        ///     <bullet_item>Length of features—The geometric length of the input features will be used to accumulate the measures. This is the default.</bullet_item><para/>
        ///     <bullet_item>Values from a single field—The value stored in a single field will be used to accumulate the measures.</bullet_item><para/>
        ///     <bullet_item>Values from two fields—The values stored in both from- and to- measure fields will be used to set the measures.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何获取路由度量。</para>
        ///   <bulletList>
        ///     <bullet_item>要素长度—输入要素的几何长度将用于累积测量值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>单个字段中的值 - 存储在单个字段中的值将用于累积度量值。</bullet_item><para/>
        ///     <bullet_item>来自两个字段的值 - 存储在 from- 和 to- 测量字段中的值将用于设置测量值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public CreateRoutes(object _in_line_features, object _route_id_field, object _out_feature_class, _measure_source_value _measure_source)
        {
            this._in_line_features = _in_line_features;
            this._route_id_field = _route_id_field;
            this._out_feature_class = _out_feature_class;
            this._measure_source = _measure_source;
        }
        public override string ToolboxName => "Linear Referencing Tools";

        public override string ToolName => "Create Routes";

        public override string CallName => "lr.CreateRoutes";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "ZDomain", "configKeyword", "extent", "outputCoordinateSystem", "outputZFlag", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_line_features, _route_id_field, _out_feature_class, _measure_source.GetGPValue(), _from_measure_field, _to_measure_field, _coordinate_priority.GetGPValue(), _measure_factor, _measure_offset, _ignore_gaps.GetGPValue(), _build_index.GetGPValue()];

        /// <summary>
        /// <para>Input Line Features</para>
        /// <para>The features from which routes will be created.</para>
        /// <para>将从中创建路由的要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Line Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_line_features { get; set; }


        /// <summary>
        /// <para>Route Identifier Field</para>
        /// <para>The field containing values that uniquely identify each route.</para>
        /// <para>包含唯一标识每个路由的值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Route Identifier Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _route_id_field { get; set; }


        /// <summary>
        /// <para>Output Route Feature Class</para>
        /// <para>The feature class to be created. It can be a shapefile or a geodatabase feature class.</para>
        /// <para>要创建的要素类。它可以是 shapefile 或地理数据库要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Route Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Measure Source</para>
        /// <para><xdoc>
        ///   <para>Specifies how route measures will be obtained.</para>
        ///   <bulletList>
        ///     <bullet_item>Length of features—The geometric length of the input features will be used to accumulate the measures. This is the default.</bullet_item><para/>
        ///     <bullet_item>Values from a single field—The value stored in a single field will be used to accumulate the measures.</bullet_item><para/>
        ///     <bullet_item>Values from two fields—The values stored in both from- and to- measure fields will be used to set the measures.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何获取路由度量。</para>
        ///   <bulletList>
        ///     <bullet_item>要素长度—输入要素的几何长度将用于累积测量值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>单个字段中的值 - 存储在单个字段中的值将用于累积度量值。</bullet_item><para/>
        ///     <bullet_item>来自两个字段的值 - 存储在 from- 和 to- 测量字段中的值将用于设置测量值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Measure Source")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _measure_source_value _measure_source { get; set; }

        public enum _measure_source_value
        {
            /// <summary>
            /// <para>Length of features</para>
            /// <para>Length of features—The geometric length of the input features will be used to accumulate the measures. This is the default.</para>
            /// <para>要素长度—输入要素的几何长度将用于累积测量值。这是默认设置。</para>
            /// </summary>
            [Description("Length of features")]
            [GPEnumValue("LENGTH")]
            _LENGTH,

            /// <summary>
            /// <para>Values from a single field</para>
            /// <para>Values from a single field—The value stored in a single field will be used to accumulate the measures.</para>
            /// <para>单个字段中的值 - 存储在单个字段中的值将用于累积度量值。</para>
            /// </summary>
            [Description("Values from a single field")]
            [GPEnumValue("ONE_FIELD")]
            _ONE_FIELD,

            /// <summary>
            /// <para>Values from two fields</para>
            /// <para>Values from two fields—The values stored in both from- and to- measure fields will be used to set the measures.</para>
            /// <para>来自两个字段的值 - 存储在 from- 和 to- 测量字段中的值将用于设置测量值。</para>
            /// </summary>
            [Description("Values from two fields")]
            [GPEnumValue("TWO_FIELDS")]
            _TWO_FIELDS,

        }

        /// <summary>
        /// <para>From-Measure Field</para>
        /// <para>A field containing measure values. This field must be numeric and is required when the measure source is Values from a single field or Values from two fields.</para>
        /// <para>包含度量值的字段。此字段必须为数值，并且当度量源为“来自单个字段的值”或“来自两个字段的值”时，此字段是必需的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("From-Measure Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _from_measure_field { get; set; } = null;


        /// <summary>
        /// <para>To-Measure Field</para>
        /// <para>A field containing measure values. This field must be numeric and is required when the measure source is Values from two fields.</para>
        /// <para>包含度量值的字段。此字段必须为数值，并且当度量源为“来自两个字段的值”时是必需的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("To-Measure Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _to_measure_field { get; set; } = null;


        /// <summary>
        /// <para>Coordinate Priority</para>
        /// <para><xdoc>
        ///   <para>The position from which measures will be accumulated for each output route. This parameter is ignored when the measure source is Values from two fields.</para>
        ///   <bulletList>
        ///     <bullet_item>Upper left corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's upper left corner. This is the default.</bullet_item><para/>
        ///     <bullet_item>Lower left corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's lower left corner.</bullet_item><para/>
        ///     <bullet_item>Upper right corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's upper right corner.</bullet_item><para/>
        ///     <bullet_item>Lower right corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's lower right corner.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>每个输出路由的测量值累积位置。当度量源为“来自两个字段的值”时，将忽略此参数。</para>
        ///   <bulletList>
        ///     <bullet_item>左上角 - 将从最接近最小边界矩形左上角的点开始累积度量值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>左下角 - 测量值将从最接近最小边界矩形左下角的点开始累积。</bullet_item><para/>
        ///     <bullet_item>右上角 - 测量值将从最接近最小边界矩形右上角的点开始累积。</bullet_item><para/>
        ///     <bullet_item>右下角 - 测量值将从最接近最小边界矩形右下角的点开始累积。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Coordinate Priority")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _coordinate_priority_value _coordinate_priority { get; set; } = _coordinate_priority_value._UPPER_LEFT;

        public enum _coordinate_priority_value
        {
            /// <summary>
            /// <para>Upper left corner</para>
            /// <para>Upper left corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's upper left corner. This is the default.</para>
            /// <para>左上角 - 将从最接近最小边界矩形左上角的点开始累积度量值。这是默认设置。</para>
            /// </summary>
            [Description("Upper left corner")]
            [GPEnumValue("UPPER_LEFT")]
            _UPPER_LEFT,

            /// <summary>
            /// <para>Lower left corner</para>
            /// <para>Lower left corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's lower left corner.</para>
            /// <para>左下角 - 测量值将从最接近最小边界矩形左下角的点开始累积。</para>
            /// </summary>
            [Description("Lower left corner")]
            [GPEnumValue("LOWER_LEFT")]
            _LOWER_LEFT,

            /// <summary>
            /// <para>Upper right corner</para>
            /// <para>Upper right corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's upper right corner.</para>
            /// <para>右上角 - 测量值将从最接近最小边界矩形右上角的点开始累积。</para>
            /// </summary>
            [Description("Upper right corner")]
            [GPEnumValue("UPPER_RIGHT")]
            _UPPER_RIGHT,

            /// <summary>
            /// <para>Lower right corner</para>
            /// <para>Lower right corner—Measures will be accumulated from the point closest to the minimum bounding rectangle's lower right corner.</para>
            /// <para>右下角 - 测量值将从最接近最小边界矩形右下角的点开始累积。</para>
            /// </summary>
            [Description("Lower right corner")]
            [GPEnumValue("LOWER_RIGHT")]
            _LOWER_RIGHT,

        }

        /// <summary>
        /// <para>Measure Factor</para>
        /// <para>A value multiplied by the measure length of each input line before they are merged to create route measures. The default is 1.</para>
        /// <para>在合并每个输入行以创建路径测量之前，将每个输入行的度量长度乘以该值。默认值为 1。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Measure Factor")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _measure_factor { get; set; } = 1;


        /// <summary>
        /// <para>Measure Offset</para>
        /// <para>A value added to the route measures after the input lines have been merged to create a route. The default is 0.</para>
        /// <para>在合并输入线以创建路径后添加到路径度量值的值。默认值为 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Measure Offset")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _measure_offset { get; set; } = 0;


        /// <summary>
        /// <para>Ignore spatial gaps</para>
        /// <para><xdoc>
        ///   <para>Specifies whether spatial gaps will be ignored when calculating the measures on disjointed routes. This parameter is applicable when the measure source is Length of features or Values from a single field.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Spatial gaps will be ignored. Measure values will be continuous for disjointed routes. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Do not ignore spatial gaps. The measure values on disjointed routes will have gaps. The gap distance is calculated using the straight-line distance between the endpoints of the disjointed parts.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在计算不相交路径上的测量值时是否忽略空间间隙。当测量源为要素长度或单个字段的值时，此参数适用。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将忽略空间间隙。对于不相交的路径，测量值将是连续的。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不要忽略空间间隙。不相交路径上的测量值将存在间隙。间隙距离是使用不相交零件端点之间的直线距离计算的。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore spatial gaps")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_gaps_value _ignore_gaps { get; set; } = _ignore_gaps_value._true;

        public enum _ignore_gaps_value
        {
            /// <summary>
            /// <para>IGNORE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("IGNORE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_IGNORE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_IGNORE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Build index</para>
        /// <para><xdoc>
        ///   <para>Specifies whether an attribute index will be created for the route identifier field that is written to the output route feature class.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Create an attribute index. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Do not create an attribute index.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否为写入输出路径要素类的路径标识符字段创建属性索引。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 创建属性索引。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 （Unchecked） - 不创建属性索引。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Build index")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _build_index_value _build_index { get; set; } = _build_index_value._true;

        public enum _build_index_value
        {
            /// <summary>
            /// <para>INDEX</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("INDEX")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_INDEX</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_INDEX")]
            [GPEnumValue("false")]
            _false,

        }

        public CreateRoutes SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object ZDomain = null, object configKeyword = null, object extent = null, object outputCoordinateSystem = null, object outputZFlag = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, ZDomain: ZDomain, configKeyword: configKeyword, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputZFlag: outputZFlag, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}